﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAO;
using BUS;


namespace FDeal.WUC
{
    public partial class WUC_DN_Comment : System.Web.UI.UserControl
    {
        string idDN;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                idDN = ((THONGTINTAIKHOAN)(Session["nguoiDung"])).IDTAIKHOAN;
            }
        }

        protected void btn_Comment_Click(object sender, EventArgs e)
        {
            idDN = ((THONGTINTAIKHOAN)(Session["nguoiDung"])).IDTAIKHOAN;

            BUS.CommentBUS cmmBus = new BUS.CommentBUS();

             DAO.COMMENT cm = new DAO.COMMENT();
              cm.IDCOMMENT = "CM" + (cmmBus.LietKe().Count + 1).ToString("000000");
              cm.IDTAIKHOAN = idDN;//"TTTK000002"
             cm.NGAY = DateTime.Now;
             cm.NOIDUNG = txt_NoiDung.Text.Trim();

              new BUS.CommentBUS().Them(cm);
              txt_NoiDung.Text = "";
        }
    }
}